package com.maxlen.common.exception;

/**
 * 系统错误码
 * 列表：
 *      10：通用
 *          001：参数格式校验
 *          002：用户未登录
 *          003：没有权限
 *      11：商品
 */
public enum ExceptionCode {

    UNKNOWN_EXCEPTION(10000, "系统未知异常"),
    VALID_EXCEPTION(10001, "参数格式校验失败"),

    USER_NOT_LOGIN(10002, "用户未登录"),
    USER_ACCOUNT_EXPIRED(10002, "账号已过期"),
    USER_ACCOUNT_ALREADY_EXIST(10002, "账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(10002, "账号下线"),

    USER_CREDENTIALS_ERROR(10003, "密码错误"),
    USER_CREDENTIALS_EXPIRED(10004, "密码过期"),
    USER_ACCOUNT_DISABLE(10005, "账号不可用"),
    USER_ACCOUNT_LOCKED(10006, "账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(10007, "账号不存在"),

    NO_PERMISSION(10008, "当前账号没有此权限"),

    PRODUCT_UP_EXCEPTION(11000, "商品上架异常");

    private Integer code;

    private String msg;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    ExceptionCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
